package io.gitee.wminyu.day02;

import java.util.Scanner;

public class Caculatemonth {
    public static void main(String[] args){
        Scanner input = new Scanner (System.in);
        int year;
        int month;
        System.out.println("请输入年份");
        year = input.nextInt();
        System.out.println("请输入月份");
        month = input.nextInt();
        if (month == 2 && year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
            year = '3';
        } else if(month == 1||month==3||month==5||month==7||month==8||month==10||month==12){
            year = '1';
        }else if(month==2){
            year = '4';
        }
        else {
            year = '2';
        }
        switch (year) {
            case '1':System.out.println("31天");break;
            case '2':System.out.println("30天");break;
            case '3':System.out.println("29天");break;
            case '4':System.out.println("28天");break;
        }
    }

}
